﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Throw_In.ViewModels;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace Throw_In
{
    public partial class TwitterPage : PhoneApplicationPage
    {
        string message = "";
        public TwitterPage()
        {
            Initialize();
        }
        private void Initialize()
        {
            InitializeComponent();
            ItemViewModel item = new ItemViewModel();
            if (PhoneApplicationService.Current.State.ContainsKey("Share"))
            {
                item = (ItemViewModel)PhoneApplicationService.Current.State["Share"];
            }
            string site = "https://twitter.com/intent/tweet?source=webclient&text=" + item.Title+". "+item.Url;
            webBrowser.Navigate(new Uri(site, UriKind.Absolute));
        }
        private void appBarChange(object sender, ApplicationBarStateChangedEventArgs e)
        {

        }

        private void homeClick(object sender, EventArgs e)
        {
            NavigationService.Navigate(new Uri("/Home.xaml?", UriKind.Relative));
        }
        private void aboutClick(object sender, EventArgs e)
        {
            NavigationService.Navigate(new Uri("/About.xaml?", UriKind.Relative));
        }
    }
}